<template>
	<view class="">
		<u-sticky bgColor="#a3d8f5">
			<view class="mainpadding" :style="{paddingTop:menutop+'rpx'}">
				<view class="flexleft">
					<image src="@/static/image/system/hsz.png" class="hszclass" mode=""></image>
					<view class="xiaobai fonweight" style="font-size: 35rpx;">红十字基金会“孤寡老人大病救助基金”</view>
				</view>
				<view class="margin_top flexbetween">
					<u-icon name="arrow-left" color="#fff" size="24" @click="backpage()"></u-icon>
					<view class="xiaobai fonweight sanshier" style="font-size: 32rpx;">{{type==1?"用户协议":"隐私政策"}}</view>
					<image src="@/static/image/system/list.png" mode="" class="topliclass" @click="toplistfn"></image>
				</view>
			</view>
		</u-sticky>
		<view class="mainpadding">
			<u-parse :content="content"></u-parse>
		</view>
	</view>
	
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				// #ifdef H5
				menutop: 80,
				// #endif
				// #ifdef MP-WEIXIN
				menutop: 0,
				// #endif	
				content:'',
				type:1,//1用户协议，2隐私政策
			}
		},
		onLoad(options) {
			// #ifdef MP-WEIXIN
			this.menutop = uni.getMenuButtonBoundingClientRect().top * 2
			// #endif
			this.type = options.type
			if(options.type==1){
				uni.setNavigationBarTitle({
					title:"用户协议"
				})
			}else if(options.type==2){
				uni.setNavigationBarTitle({
					title:"隐私政策"
				})
			}
			this.get()
		},
		methods: {
			async get(){
				let res = await httpRequest.request('/api/index/getConfigInfoItem', 'GET', {
					pidtype:"about_set",
					type:this.type==1?'user_xy':'user_yszc'
				})
				if (res.code == 1) {
					
					this.content=res.data
				} else if (res.code == 0) {
					httpRequest.toast(res.msg)
				} else {
					httpRequest.toast('網絡有問題');
				}
			}
		}
	}
</script>

<style>

</style>
